Knuth-Yao speedup